<extend name="Public/base" />
<block name="style">
<link rel="stylesheet" href="__STATIC__/jquery-ui/css/jquery-ui.min.css"
	type="text/css" media="screen" />
<link rel="stylesheet"
	href="__STATIC__/plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css"
	type="text/css" media="screen" />
<script type="text/javascript"
	src="__STATIC__/jquery-ui/js/jquery-ui.min.js"></script>
<script type="text/javascript"
	src="__STATIC__/plupload/js/plupload.full.min.js"></script> <script
	type="text/javascript"
	src="__STATIC__/plupload/js/jquery.ui.plupload/jquery.ui.plupload.js"></script>
<script type="text/javascript"
	src="__STATIC__/plupload/js/i18n/zh_CN.js"></script> 
</block>
<block name="body"> <!-- 标题栏 -->

<div class="main-title">
	<h2>文件上传</h2>
</div>

<div id="uploader">
	<p>您的浏览器没有 Flash, Silverlight 或 HTML5 支持。</p>
</div>

</block>

<block name="script"> <script type="text/javascript">
	// Initialize the widget when the DOM is ready
	$(function() {
		$("#uploader").plupload({
			// General settings
			runtimes : 'html5,flash,silverlight,html4',
			url : "{:U('upload')}",
	
			// User can upload no more then 20 files in one go (sets multiple_queues to false)
			max_file_count : 20,

			chunk_size : '1mb',

			// Resize images on clientside if we can
			resize : {
				width : 200,
				height : 200,
				quality : 90,
				crop : true
			// crop to exact dimensions
			},

			
			filters : {
				// Maximum file size
				max_file_size : '1000mb',
				// Specify what files to browse for
				mime_types : [ {
					title : "Image files",
					extensions : "jpg,gif,png"
				}, {
					title : "Zip files",
					extensions : "zip"
				} ]
			},

			// Rename files by clicking on their titles
			rename : true,

			// Sort files
			sortable : true,

			// Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)
			dragdrop : true,

			unique_names : true,
			

			// Views to activate
			views : {
				list : true,
				thumbs : true, // Show thumbs
				active : 'thumbs'
			},

			// Flash settings
			flash_swf_url : '__STATIC__/plupload/js/Moxie.swf',

			// Silverlight settings
			silverlight_xap_url : '__STATIC__/plupload/js/Moxie.xap'
			
		});

		$("#uploader").on('complete', function() {		
			if(window.confirm("上传成功,是否继续上传？")){
				//window.location.reload();
				Window.location.href="{:U('index')}";
			}else{
				window.history.back();
			}

		});	

	});
</script> </block>
